#import "UnveilVortexCell.h"


@implementation UnveilVortexCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
	self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
	if (self) {

		self.selectionStyle = UITableViewCellSelectionStyleNone;
		//self.contentView.backgroundColor = UIColor.whiteColor;

		//: 初始化UI布局
		[self onyxKiteZealConfigViews];
	}
	return self;
}

- (void)setPirateClarity:(UnveilVortexModel *)pirateClarity {
	_pirateClarity = pirateClarity;

	//: 配置cell的UI

[self.rippleDreamscapeImageView sd_setImageWithURL:[NSURL URLWithString:pirateClarity.flourishApprehension.stringValue] placeholderImage:nil];

	[self.anticipateUpliftNirvanaImageView sd_setImageWithURL:[NSURL URLWithString:pirateClarity.libertyWaffle] placeholderImage:nil];

	self.gratitudeLabel.text = [NSString stringWithFormat:@"Count: %lu", (unsigned long)pirateClarity.thriveBreeze.count];

	self.hopefulJourneyLabel.text = [pirateClarity.journey stringValue];

}
//: 设置_anticipateUpliftNirvanaImageView的圆角
- (void)freedomGraspAbandon:(UIImageView *)thriveNostalgia xylophoneLullaby:(CGFloat)eclipse {
	thriveNostalgia.layer.cornerRadius = eclipse;
	thriveNostalgia.layer.masksToBounds = YES;
}

- (UIImageView *)anticipateUpliftNirvanaImageView {
	if (!_anticipateUpliftNirvanaImageView) {
	
        _anticipateUpliftNirvanaImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
        _anticipateUpliftNirvanaImageView.contentMode = UIViewContentModeScaleAspectFill;
        _anticipateUpliftNirvanaImageView.clipsToBounds = YES;
        //: UIImageView的骚操作 充数
        [self freedomGraspAbandon:_anticipateUpliftNirvanaImageView xylophoneLullaby:12];
        UIImage *balance = [UIImage imageNamed:@"images/image_2.png"];
        if (balance) {
	        _anticipateUpliftNirvanaImageView.image = balance;
        }
	}
	return _anticipateUpliftNirvanaImageView;
}

- (UILabel *)hopefulJourneyLabel {
	if (!_hopefulJourneyLabel) {
	
        _hopefulJourneyLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        _hopefulJourneyLabel.frame = CGRectMake(21, 5, 89, 140);
        _hopefulJourneyLabel.text = @"label_5";
        _hopefulJourneyLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold];
        _hopefulJourneyLabel.textColor = [UIColor colorWithRed:125/255.0 green:137/255.0 blue:26/255.0 alpha:0.6];
        _hopefulJourneyLabel.textAlignment = NSTextAlignmentRight;
        //: 不用理会的骚操作 = _hopefulJourneyLabel.numberOfLines = 1;
        NSInteger navigateYarn = 1;
        if (navigateYarn>50 && navigateYarn < 7564) {
	        navigateYarn = 54;
	        NSString *echoAmberWhimsy = [NSString stringWithFormat:@"%ld", (long)navigateYarn];
	        if (echoAmberWhimsy.length>94 && [echoAmberWhimsy isEqualToString:_hopefulJourneyLabel.text]) {
		        navigateYarn = echoAmberWhimsy.integerValue * 3;
	        }
        }
        _hopefulJourneyLabel.numberOfLines = navigateYarn;
	}
	return _hopefulJourneyLabel;
}

- (void)onyxKiteZealConfigViews {

    //: 描述_0
    UILabel *peacefulPirate = [[UILabel alloc] initWithFrame:CGRectZero];
    peacefulPirate.size = CGSizeMake(191, 152);
    peacefulPirate.left = 33;
    peacefulPirate.top = 36;
    peacefulPirate.text = @"label_0";
    peacefulPirate.font = [UIFont systemFontOfSize:16 weight:UIFontWeightRegular];
    peacefulPirate.textColor = [UIColor colorWithRed:141/255.0 green:134/255.0 blue:40/255.0 alpha:0.7];
    peacefulPirate.textAlignment = NSTextAlignmentLeft;
    peacefulPirate.numberOfLines = 0;
    self.echoIgniteLabel = peacefulPirate;
    [self.contentView addSubview:peacefulPirate];


    //: 描述_1
    self.rippleDreamscapeImageView = [[UIImageView alloc] init];
    self.rippleDreamscapeImageView.contentMode = UIViewContentModeScaleAspectFill;
    self.rippleDreamscapeImageView.clipsToBounds = YES;
    self.rippleDreamscapeImageView.layer.cornerRadius = 2;
    self.rippleDreamscapeImageView.layer.masksToBounds = YES;
    self.rippleDreamscapeImageView.frame = CGRectMake(12, 29, 37, 162);
    UIImage *peacefulLibertySuspicion = [UIImage imageNamed:@"images/image_1.png"];
    if (peacefulLibertySuspicion) {
	    self.rippleDreamscapeImageView.image = peacefulLibertySuspicion;
    }
    [self.contentView addSubview:self.rippleDreamscapeImageView];

	//: 描述_2
	[self.contentView addSubview:self.anticipateUpliftNirvanaImageView];
	[self.anticipateUpliftNirvanaImageView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(48);
		make.height.mas_equalTo(193);
		make.top.equalTo(@(13));
	}];


    //: 描述_3
    UIView *lushMerge = [[UIView alloc] initWithFrame:CGRectZero];
    self.quakeElusiveArtistryView = lushMerge;
    [self.contentView addSubview:lushMerge];
	[self.quakeElusiveArtistryView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(179);
		make.height.mas_equalTo(133);
		make.top.equalTo(@(25));
	}];


    //: 描述_4
    self.gratitudeLabel = [[UILabel alloc] initWithFrame:CGRectZero];
    self.gratitudeLabel.text = @"label_4";
    self.gratitudeLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
    self.gratitudeLabel.textColor = [UIColor colorWithRed:42/255.0 green:103/255.0 blue:157/255.0 alpha:0.6];
    self.gratitudeLabel.textAlignment = NSTextAlignmentCenter;
    self.gratitudeLabel.numberOfLines = 0;
    [self.contentView addSubview:self.gratitudeLabel];
	[self.gratitudeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(127);
		make.height.mas_equalTo(102);
		make.bottom.equalTo(@(14));
	}];

	//: 描述_5
	[self.contentView addSubview:self.hopefulJourneyLabel];
}


@end